Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new map filters #1090

Merged
merged 18 commits into from
Feb 10, 2025
Merged

Add new map filters #1090

merged 18 commits into from
Feb 10, 2025

Conversation

K-Markopoulos
Copy link
Collaborator

@K-Markopoulos K-Markopoulos commented Feb 3, 2025

Add new map filters figma. Closes #1066

  • Add reefCheckData property to each site in /sites response which includes some attributes for the site in order to use them for filtering in UI.
  • Add new modal for filters.
  • Refactor sites store, filters are in state and displayedSites is a selector now.
  • Expand by default categories with active filters
  • Store filters in URL, so they can be shared with URL . Load filters on page load.

Other:

image

image

@K-Markopoulos K-Markopoulos self-assigned this Feb 3, 2025
@ericboucher
Copy link
Member

You can maybe address #1078 as well in this PR since we're touching at the main page?

Copy link

github-actions bot commented Feb 4, 2025

Build succeeded and deployed at https://aqualink-app-1090.surge.sh
(hash 3909d72 deployed at 2025-02-10T14:14:00)

@K-Markopoulos K-Markopoulos marked this pull request as ready for review February 5, 2025 16:01
.select('survey.site_id', 'siteId')
.addSelect('json_agg(distinct rco.organism)', 'organism')
.leftJoin('reef_check_organism', 'rco', 'rco.survey_id = survey.id')
.where('rco.s1 > 0')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it simplify a bit to so something like this? .where('(rco.s1 + rco.s2 + rco.s3 + rco.s4) > 0')
Or maybe not? Not sure if it would make it faster

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would assume that with multiple simple predicates (s1 > 0 or s2 > 0) postgres would be able to do more optimizations and therefore it would be faster, but after analyzing the query plan and the execution time it seems they are equivalent. It likely won't make it faster or slower, but it would make it simpler, so let's go with your suggestion.

@ericboucher ericboucher merged commit 5140be8 into master Feb 10, 2025
4 checks passed
@ericboucher ericboucher deleted the map-filters branch February 10, 2025 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Change color search bar Reef Check - new filter button for the map
2 participants